package com.example.basefream.controller;


import com.example.basefream.service.RetryService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/*
* 接口重试机制实现测试
* */
@Api(tags = {"使用Retry实现接口重试机制"})
@RestController
@RequestMapping("/retry")
public class RetryController {

    @Autowired
    private RetryService retryService;

    @RequestMapping(value = "/transfer", method = RequestMethod.GET)
    public String transferAccounts() {
        try {
            retryService.retryTransferAccounts(1, 2, 200);
            return "ok";
        } catch (Exception e) {
            return "no";
        }
    }
}